
package cn.chochy.my.util;

/**
 *
 * @author MLeo
 */
public class StringFindImageUrl {

    /**
     * 查找内容中的图片路径
     *
     * @param content
     * @return String
     */
    public static String findImageUrl(String content) {
        int beginIndex = content.indexOf("img");
        String url = "images/default.gif";
        if (0 < beginIndex) {
            beginIndex = content.indexOf("http", beginIndex);
            int endIndex = content.indexOf("\"", beginIndex);
            url = content.substring(beginIndex, endIndex);
        }
        return url;
    }
}
